﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace WebApplication1
{
    public class Connection
    {
        public SqlConnection connect()
        {
            string connectionString= System.Configuration.ConfigurationManager.ConnectionStrings["connmTunez"].ToString();           
            SqlConnection conn = new SqlConnection(connectionString);
            conn.Open();
            return conn;
        }

        public SqlCommand sqlCmd(SqlConnection connection)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = connection;
            return cmd;
        }

        public SqlCommand sqlCmd(SqlConnection connection, System.Data.CommandType cmdType)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = connection;
            cmd.CommandType = cmdType;

            return cmd;
        }

    }
}